<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 解构赋值：目的： 快速的取值 

    const obj = {
      username: 'zs',
      age: 18,
      car: {
        name: '劳斯莱斯',
        price: 1000
      },
      house: {
        name: '新疆海景房',
        price: 5
      }
    }


    // 取出对象obj的car和house属性
    const {car:{name,price},house:{name:name1,price:price1}} = obj
    console.log(name,price,name1,price1)
  </script>
</body>

</html>